#!/usr/bin/env bash

ARG_NAME=lang
if /usr/sbin/mdata-get ${ARG_NAME} 1>/dev/null 2>&1; then
    ARG_VALUE=$(/usr/sbin/mdata-get ${ARG_NAME}) 
else
    ARG_VALUE=en_US.UTF-8
fi
gsed -i "s|^LANG=.*|LANG=${ARG_VALUE}|" /etc/default/init

ARG_NAME=timezone
if /usr/sbin/mdata-get ${ARG_NAME} 1>/dev/null 2>&1; then
    ARG_VALUE=$(/usr/sbin/mdata-get ${ARG_NAME})    
    if [ -f /usr/share/lib/zoneinfo/${ARG_VALUE} ];then
        gsed -i "s|^TZ=.*|TZ=${ARG_VALUE}|" /etc/default/init       
    fi  
fi  

source /etc/default/init



 